<?php

namespace Modules\System\Models;

use Illuminate\Database\Eloquent\Model;
use Modules\System\Services\Mds\MDSArray;

class ConfigModel extends Model
{

    public $table = 'ca_config';


    protected function getKV($group = ''){

        if(empty($group)){
            $config = self::get();
        }else{
            $config = self::where("group",$group)->get();
        }

        $data = MDSArray::arraykeyVal($config,'field','val');

        return $data;

    }


}
